import { ApiService } from '~/common/api/api-service'

class DetectionService {
  private apiService: ApiService
  
  constructor() {
    // 修改这行，去掉 /api 前缀
    this.apiService = new ApiService('/detection')
  }

  /**
   * 运行Web缺陷识别
   */
  async runWebDetection(): Promise<any> {
    return await this.apiService.post<any>('web', {})
  }

  /**
   * 运行MySQL缺陷识别
   */
  async runMysqlDetection(): Promise<any> {
    return await this.apiService.post<any>('mysql', {})
  }
}

export default DetectionService